package com.example.demo.enums;

import org.springframework.context.i18n.LocaleContextHolder;

import java.util.Locale;

/**
 * @DESCRIPTION:
 * @AUTOOR: Lee
 * @DATE: 2022年09月18日 2:36
 */
public enum Status {

    ;

    private final int code;
    private final String enMsg;
    private final String zhMsg;

    Status(int code, String enMsg, String zhMsg) {
        this.code = code;
        this.enMsg = enMsg;
        this.zhMsg = zhMsg;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        if (Locale.SIMPLIFIED_CHINESE.getLanguage().equals(LocaleContextHolder.getLocale().getLanguage())) {
            return this.zhMsg;
        } else {
            return this.enMsg;
        }
    }



}
